﻿using CommunityToolkit.Mvvm.Messaging;

namespace MG.SmartHMI.View
{
    /// <summary>
    /// LayoutView.xaml 的交互逻辑
    /// </summary>
    public partial class LayoutView : System.Windows.Controls.UserControl
    {
        public LayoutView()
        {
            InitializeComponent();
        }

        private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            WeakReferenceMessenger.Default.Send(string.Empty, "LayoutViewLoadSignal");
        }

        private void UserControl_Unloaded(object sender, System.Windows.RoutedEventArgs e)
        {
            WeakReferenceMessenger.Default.Send(string.Empty, "LayoutViewUnLoadSignal");
            Thread.Sleep(20); // 等待1秒，确保所有线程都已结束
        }
    }
}